#pragma once
#include <string>
#include "JSerialize.h"

enum JWorkingCopiesFileOperation
{
	JWorkingFileAdd,
	JWorkingFileDelete,
	JWorkingFileNotExist,
	JWorkingFileNoStatus
};

//
class JWorkingCopiesBaseFile : public JSerialize
{
public:
    JWorkingCopiesBaseFile();
    JWorkingCopiesBaseFile(JWorkingCopiesFileOperation _operate,int _lastChangeVersion,
                int _version,std::string _author,std::string _fullFileName,int _dirOrFile);
	~JWorkingCopiesBaseFile(void);
	//Serialize begin.
	JWorkingCopiesFileOperation operate;
	int lastChangeVersion;
	//Through "version" to judge whether file is from repository.
	int version;
	std::string author;
	std::string fullFileName;
	int dirOrFile;
	//Serialize end.
	int Serialize(std::iostream& _strea,int& allSize);
	void ReSerialize(std::iostream& _strea);
        
	bool operator == (const JWorkingCopiesBaseFile& _file);
	static std::string FileOperationToString(JWorkingCopiesFileOperation operation);
private:
	//int EnumtoInt(JWorkingCopiesFileOperation _operate);
};
